package 强化训练;

import java.util.Scanner;

public class 两字符串组成回文串个数 {
    public static void main(String[] args){
        float f = -12;
        double x = 0x123;
        double c = 1e9;
        long d = 012;


        Scanner sc = new Scanner(System.in);
        String A = sc.next();
        String B = sc.next();
        int lena = A.length();
        int lenb = B.length();
        int count = 1;
        int res = 0;
        for(int i = 0 ; i <= lena ; i ++){
            String s = A.substring(0,i) + B + A.substring(i,lena);
            res += help(s);
        }
        System.out.println(res);
    }
    public static int help(String s){
        int i = 0;
        int j = s.length() - 1;
        while(i <= j){
            if(s.charAt(i) == s.charAt(j)){
                i++;
                j--;
            }else{
                return 0;
            }
        }
        return 1;
    }
}
